// fileName      :  iresponse.go
// createdAt     :  2021-10-30
// description   :

package gin

import (
	"net/http"
)

type IResponse interface {
	//	Json(map[string]interface{}) IResponse
	JsonOK(map[string]interface{}) IResponse

	// Json404 (map[string]interface{})
	Json404(data map[string]interface{}) IResponse

	// Json400 (map[string]interface{})
	Json400(data map[string]interface{}) IResponse

	// Json500 (map[string]interface{})
	Json500(data map[string]interface{}) IResponse

	// Json500Interface (map[string]interface{})
	Json500Interface(data interface{}) IResponse

	// JsonOkInterface (interface{})
	JsonOkInterface(data interface{}) IResponse

	// Json400Interface (interface{})
	Json400Interface(data interface{}) IResponse
}

func (c *Context) JsonOK(data map[string]interface{}) IResponse {
	c.JSON(http.StatusOK, data)
	return c
}

func (c *Context) JsonOkInterface(data interface{}) IResponse {
	c.JSON(http.StatusOK, data)
	return c
}

func (c *Context) Json400Interface(data interface{}) IResponse {
	c.JSON(http.StatusBadRequest, data)
	return c
}

func (c *Context) Json404(data map[string]interface{}) IResponse {
	c.JSON(http.StatusNotFound, data)
	return c
}

func (c *Context) Json400(data map[string]interface{}) IResponse {
	c.JSON(http.StatusBadRequest, data)
	return c
}

func (c *Context) Json500(data map[string]interface{}) IResponse {
	c.JSON(http.StatusInternalServerError, data)
	return c
}

func (c *Context) Json500Interface(data interface{}) IResponse {
	c.JSON(http.StatusInternalServerError, data)
	return c
}
